/********************************************************************************
 * ContactUsAction.java
 *
 * Created by Jigar Mistry
 * Last modified Date: Aug 26, 2008 3:20:10 PM by Jigar Mistry
 * Version : 0.1
 * Copyright (c) 2008 - 2009 cyberThink Infotech Pvt. Ltd., All rights reserved.
 ********************************************************************************/

package com.printeverywhere.action;

import org.apache.log4j.Logger;

import com.printeverywhere.delegator.ContactUsServiceDelegator;
import com.printeverywhere.dto.ContactUs;
import com.printeverywhere.util.DateUtil;

/**
 * The Class ContactUsAction.
 */
public class ContactUsAction extends FrontBaseSupport {

	public ContactUsAction() {
		super(false, false);
	}

	/** Logger for this class. */
	private static final Logger logger = Logger.getLogger(ContactUsAction.class);

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	private ContactUs contact;


	public ContactUs getContact() {
		return contact;
	}

	public void setContact(ContactUs contact) {
		this.contact = contact;
	}

	public String showContactUs() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("showContactUs() - start"); //$NON-NLS-1$
		}

		if (logger.isDebugEnabled()) {
			logger.debug("showContactUs() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public String addContactUs() throws Exception{
		if (logger.isDebugEnabled()) {
			logger.debug("addContactUs() - start"); //$NON-NLS-1$
		}
		this.contact.setCreatedDate(DateUtil.getTodaysDate());
		ContactUsServiceDelegator.insertContactUs(contact);

		if (logger.isDebugEnabled()) {
			logger.debug("addContactUs() - start"); //$NON-NLS-1$
		}
		return SUCCESS;
	}


}